<!--加载js-->
<script src="/static/common/plugins/Charts/amcharts.js" type="text/javascript"></script>

<!--主页面-->
<div class="side-left fl mt10">
    <div class="box">
        <h2>个人信息</h2>
        <ul class="status">
            <li class="risk first-child">
                <p>
                    <i class="img">{if condition="!empty($admin_info['avatar'])"}<img src="{$admin_info['avatar']}">{/if}</i>
                    <strong>{$admin_info['real_name']}</strong><br><span class="gray">注册时间：{$admin_info['login_time']}<br>注册IP：{$admin_info['login_ip']}</span>
                </p>
                <a class="status-btn exam"  style="" href="{:Url('admin/agent_admin_upd')}">完善信息</a>
            </li>
            <li><p><span class="fl">最后登录数据：{$admin_info['login_time']}</span><span class="fr">最后登录IP：{$admin_info['login_ip']}</span></p></li>
        </ul>
    </div>
    <div class="box">
        <h2>主要功能快捷入口</h2>
        <div class="clear_fix">
            <ul class="entrance">
                <li style="height: 32px;">
                    <a href="{:Url('credit/credit_apply_dispatch_all_list')}"><img src="/static/admin/img/dp_icon2.gif" class="fl" style="width: 35px;height: 30px;"></a>
                    <a class="txt" href="{:Url('credit/credit_apply_dispatch_all_list')}">
                        <h2>我的信用卡工单</h2>
                    </a>
                </li>
                <li style="height: 32px;">
                    <a href="{:Url('loan/loan_apply_dispatch_all_list')}"><img src="/static/admin/img/icon18.png" class="fl" style="width: 35px;height: 30px;"></a>
                    <a class="txt" href="{:Url('loan/loan_apply_dispatch_all_list')}">
                        <h2>我的银行贷工单</h2>
                    </a>
                </li>
                <li style="height: 32px;">
                    <a href="{:Url('/admin/credit_apply/credit_apply_dispatch_list')}"><img src="/static/admin/img/icon16.png" class="fl" style="width: 35px;height: 30px;"></a>
                    <a class="txt" href="{:Url('small/small_apply_dispatch_all_list')}">
                        <h2>我的极速贷工单</h2>
                    </a>
                </li>
                <li style="height: 32px;">
                    <a href="{:Url('admin/user_add')}"><img src="/static/admin/img/qd_icon3.gif" class="fl" style="width: 35px;height: 30px;"></a>
                    <a class="txt" href="{:Url('admin/user_add')}">
                        <h2>握旗客户材料录入</h2>
                    </a>
                </li>
                <li style="height: 32px;">
                    <a href="{:Url('count/count_list')}"><img src="/static/admin/img/qd_icon4.gif" class="fl" style="width: 35px;height: 30px;"></a>
                    <a class="txt" href="{:Url('count/count_list')}">
                        <h2>普融客户统计</h2>
                    </a>
                </li>
            </ul>
        </div>
    </div>
    <div class="box">
        <h2>待处理工单</h2>
        <div class="clear_fix">
            <ul class="show_total">
                <li class="fl">
                    <a href="{:url('credit/credit_apply_dispatch_list')}">
                        <img src="/static/admin/img/1.jpg" class="fl">
                        <h2 style="font-size:14px; border:none; padding:0;">[信用卡] 等待材料审核：<i class="orange">{$credit_count['pending']|default='0'}</i></h2>
                    </a>
                </li>
                <li class="fl">
                    <a href="{:url('credit/credit_apply_dispatch_audit_pass_list')}">
                        <img src="/static/admin/img/1.jpg" class="fl">
                        <h2 style="font-size:14px; border:none; padding:0;">[信用卡] 等待填写返佣：<i class="orange">{$credit_count['success']|default='0'}</i></h2>
                    </a>
                </li>
                <li class="fl">
                    <a href="{:url('loan/loan_apply_dispatch_list')}">
                        <img src="/static/admin/img/1.jpg" class="fl">
                        <h2 style="font-size:14px; border:none; padding:0;">[银行贷] 等待材料审核：<i class="orange">{$loan_count['pending']|default='0'}</i></h2>
                    </a>
                </li>
                <li class="fl">
                    <a href="{:url('loan/loan_apply_dispatch_audit_pass_list')}">
                        <img src="/static/admin/img/1.jpg" class="fl">
                        <h2 style="font-size:14px; border:none; padding:0;">[银行贷] 等待填写返佣：<i class="orange">{$loan_count['success']|default='0'}</i></h2>
                    </a>
                </li>
                <li class="fl">
                    <a href="{:url('small/small_apply_dispatch_list')}">
                        <img src="/static/admin/img/1.jpg" class="fl">
                        <h2 style="font-size:14px; border:none; padding:0;">[极速贷] 等待材料审核：<i class="orange">{$small_count['pending']|default='0'}</i></h2>
                    </a>
                </li>
                <li class="fl">
                    <a href="{:url('loan/loan_apply_dispatch_audit_pass_list')}">
                        <img src="/static/admin/img/1.jpg" class="fl">
                        <h2 style="font-size:14px; border:none; padding:0;">[极速贷] 等待填写返佣：<i class="orange">{$small_count['success']|default='0'}</i></h2>
                    </a>
                </li>
            </ul>
        </div>
    </div>
</div>



<div class="side-m fl mt10">
    <div class="box2">
        <h2>我的握旗用户走势图<font color="red">&nbsp;&nbsp;&nbsp;&nbsp;<b>备注：首页所有统计数据每小时更新一次！</b></font></h2>
        <div class="item_chart">
            <div id="amount_chart" style="width:99%; height:300px;"></div>

            <script type="text/javascript">
                var chart;

                AmCharts.ready(function () {

                    chart = new AmCharts.AmSerialChart();
                    chart.dataProvider = json['user'];
                    chart.categoryField = "reg_time";

                    var categoryAxis = chart.categoryAxis;
                    categoryAxis.dashLength = 2;
                    categoryAxis.gridAlpha = 0.15;
                    categoryAxis.axisColor = "#DADADA";

                    var valueAxis1 = new AmCharts.ValueAxis();
                    valueAxis1.axisColor = "#FF0F00";
                    valueAxis1.axisThickness = 2;
                    valueAxis1.gridAlpha = 0;
                    chart.addValueAxis(valueAxis1);

                    var graph1 = new AmCharts.AmGraph();
                    graph1.valueAxis = valueAxis1; // we have to indicate which value axis should be used
                    graph1.title = "用户数量";
                    graph1.valueField = "dl";
                    graph1.bullet = "round";
                    graph1.hideBulletsCount = 30;
                    chart.addGraph(graph1);


                    var chartCursor = new AmCharts.ChartCursor();
                    chartCursor.cursorPosition = "mouse";
                    chart.addChartCursor(chartCursor);

                    var legend = new AmCharts.AmLegend();
                    legend.marginLeft = 110;
                    chart.addLegend(legend);
                    chart.write("amount_chart");
                });
            </script>
        </div>
    </div>
    <div class="box2">
        <h2>我的工单数量走势图</h2>
        <div class="item_chart">
            <div id="apply_chart" style="width:99%; height:300px;"></div>

            <script type="text/javascript">
                var chart;

                AmCharts.ready(function () {
                    chart = new AmCharts.AmSerialChart();
                    chart.dataProvider = json['apply'];
                    chart.categoryField = "create_date";

                    var categoryAxis = chart.categoryAxis;
                    categoryAxis.dashLength = 2;
                    categoryAxis.gridAlpha = 0.15;
                    categoryAxis.axisColor = "#DADADA";

                    var valueAxis0 = new AmCharts.ValueAxis();
                    valueAxis0.axisColor = "#FF0F00";
                    valueAxis0.axisThickness = 2;
                    valueAxis0.gridAlpha = 0;
                    chart.addValueAxis(valueAxis0);

                    var valueAxis1 = new AmCharts.ValueAxis();
                    valueAxis1.position = "right";
                    valueAxis1.axisColor = "#FF0F00";
                    valueAxis1.axisThickness = 2;
                    valueAxis1.gridAlpha = 0;
                    chart.addValueAxis(valueAxis1);

                    var graph1 = new AmCharts.AmGraph();
                    graph1.valueAxis = valueAxis0;
                    graph1.title = "信用卡";
                    graph1.valueField = "credit_num";
                    graph1.bullet = "round";
                    graph1.hideBulletsCount = 30;
                    chart.addGraph(graph1);

                    var graph2 = new AmCharts.AmGraph();
                    graph2.valueAxis = valueAxis0;
                    graph2.title = "极速贷";
                    graph2.valueField = "small_num";
                    graph2.bullet = "round";
                    graph2.hideBulletsCount = 30;
                    chart.addGraph(graph2);

                    var graph3 = new AmCharts.AmGraph();
                    graph3.valueAxis = valueAxis0;
                    graph3.title = "银行贷";
                    graph3.valueField = "loan_num";
                    graph3.bullet = "round";
                    graph3.hideBulletsCount = 30;
                    chart.addGraph(graph3);

                    var chartCursor = new AmCharts.ChartCursor();
                    chartCursor.cursorPosition = "mouse";
                    chart.addChartCursor(chartCursor);

                    var legend = new AmCharts.AmLegend();
                    legend.marginLeft = 110;
                    chart.addLegend(legend);

                    chart.write("apply_chart");
                });
            </script>
        </div>
    </div>
    <div class="box2">
        <h2>我的业绩走势图</h2>
        <div class="item_chart">
            <div id="brokerage_chart" style="width:99%; height:300px;"></div>

            <script type="text/javascript">
                var chart;

                AmCharts.ready(function () {
                    chart = new AmCharts.AmSerialChart();
                    chart.dataProvider = json['brokerage'];
                    chart.categoryField = "create_date";

                    var categoryAxis = chart.categoryAxis;
                    categoryAxis.dashLength = 2;
                    categoryAxis.gridAlpha = 0.15;
                    categoryAxis.axisColor = "#DADADA";

                    var valueAxis0 = new AmCharts.ValueAxis();
                    valueAxis0.axisColor = "#FF0F00";
                    valueAxis0.axisThickness = 2;
                    valueAxis0.gridAlpha = 0;
                    chart.addValueAxis(valueAxis0);

                    var valueAxis1 = new AmCharts.ValueAxis();
                    valueAxis1.position = "right";
                    valueAxis1.axisColor = "#FF0F00";
                    valueAxis1.axisThickness = 2;
                    valueAxis1.gridAlpha = 0;
                    chart.addValueAxis(valueAxis1);

                    var graph1 = new AmCharts.AmGraph();
                    graph1.valueAxis = valueAxis0;
                    graph1.title = "信用卡";
                    graph1.valueField = "credit";
                    graph1.bullet = "round";
                    graph1.hideBulletsCount = 30;
                    chart.addGraph(graph1);

                    var graph2 = new AmCharts.AmGraph();
                    graph2.valueAxis = valueAxis0;
                    graph2.title = "极速贷";
                    graph2.valueField = "small";
                    graph2.bullet = "round";
                    graph2.hideBulletsCount = 30;
                    chart.addGraph(graph2);

                    var graph3 = new AmCharts.AmGraph();
                    graph3.valueAxis = valueAxis0;
                    graph3.title = "银行贷";
                    graph3.valueField = "loan";
                    graph3.bullet = "round";
                    graph3.hideBulletsCount = 30;
                    chart.addGraph(graph3);

                    var graph0 = new AmCharts.AmGraph();
                    graph0.valueAxis = valueAxis1;
                    graph0.title = "合计";
                    graph0.valueField = "num";
                    graph0.bullet = "round";
                    graph0.hideBulletsCount = 30;
                    chart.addGraph(graph0);

                    var chartCursor = new AmCharts.ChartCursor();
                    chartCursor.cursorPosition = "mouse";
                    chart.addChartCursor(chartCursor);

                    var legend = new AmCharts.AmLegend();
                    legend.marginLeft = 110;
                    chart.addLegend(legend);

                    chart.write("brokerage_chart");
                });
            </script>
        </div>
    </div>
    {if condition="$admin_info['is_leader'] == 2"}
        <div class="box2">
        <h2>{$admin_info['nick']}业绩走势图</h2>
        <div class="item_chart">
            <div id="brokerage_total_chart" style="width:99%; height:300px;"></div>

            <script type="text/javascript">
                var chart;

                AmCharts.ready(function () {
                    chart = new AmCharts.AmSerialChart();
                    chart.dataProvider = json['brokerage_total'];
                    chart.categoryField = "create_date";

                    var categoryAxis = chart.categoryAxis;
                    categoryAxis.dashLength = 2;
                    categoryAxis.gridAlpha = 0.15;
                    categoryAxis.axisColor = "#DADADA";

                    var valueAxis0 = new AmCharts.ValueAxis();
                    valueAxis0.axisColor = "#FF0F00";
                    valueAxis0.axisThickness = 2;
                    valueAxis0.gridAlpha = 0;
                    chart.addValueAxis(valueAxis0);

                    var valueAxis1 = new AmCharts.ValueAxis();
                    valueAxis1.position = "right";
                    valueAxis1.axisColor = "#FF0F00";
                    valueAxis1.axisThickness = 2;
                    valueAxis1.gridAlpha = 0;
                    chart.addValueAxis(valueAxis1);

                    var graph1 = new AmCharts.AmGraph();
                    graph1.valueAxis = valueAxis0;
                    graph1.title = "信用卡";
                    graph1.valueField = "credit";
                    graph1.bullet = "round";
                    graph1.hideBulletsCount = 30;
                    chart.addGraph(graph1);

                    var graph2 = new AmCharts.AmGraph();
                    graph2.valueAxis = valueAxis0;
                    graph2.title = "极速贷";
                    graph2.valueField = "small";
                    graph2.bullet = "round";
                    graph2.hideBulletsCount = 30;
                    chart.addGraph(graph2);

                    var graph3 = new AmCharts.AmGraph();
                    graph3.valueAxis = valueAxis0;
                    graph3.title = "银行贷";
                    graph3.valueField = "loan";
                    graph3.bullet = "round";
                    graph3.hideBulletsCount = 30;
                    chart.addGraph(graph3);

                    var graph0 = new AmCharts.AmGraph();
                    graph0.valueAxis = valueAxis1;
                    graph0.title = "合计";
                    graph0.valueField = "num";
                    graph0.bullet = "round";
                    graph0.hideBulletsCount = 30;
                    chart.addGraph(graph0);

                    var chartCursor = new AmCharts.ChartCursor();
                    chartCursor.cursorPosition = "mouse";
                    chart.addChartCursor(chartCursor);

                    var legend = new AmCharts.AmLegend();
                    legend.marginLeft = 110;
                    chart.addLegend(legend);

                    chart.write("brokerage_total_chart");
                });
            </script>
        </div>
    </div>
    {/if}
    {if condition="$admin_info['is_leader'] == 2"}
    <div class="box2">
        <h2>业绩分布统计</h2>
        <div class="item_chart">
            <div id="brokerage_all_chart_2" style="width:49%; height:400px; float:left;"></div>
            <script type="text/javascript">
                var chart;
                AmCharts.ready(function () {
                    chart = new AmCharts.AmPieChart();
                    chart.addTitle("我的业绩分布", 16);
                    chart.dataProvider = json['brokerage_all'];
                    chart.titleField = "title";
                    chart.valueField = "amount";
                    chart.sequencedAnimation = true;
                    chart.startEffect = "elastic";
                    chart.innerRadius = "30%";
                    chart.startDuration = 2;
                    chart.labelRadius = 15;
                    chart.depth3D = 10;
                    chart.angle = 15;
                    chart.write("brokerage_all_chart_2");
                });
            </script>
            <div id="brokerage_all_chart" style="width:49%; height:400px; float:left;"></div>
            <script type="text/javascript">
                var chart;
                AmCharts.ready(function () {
                    chart = new AmCharts.AmPieChart();
                    chart.addTitle("{$admin_info['nick']}业绩分布", 16);
                    chart.dataProvider = json['brokerage_all_total'];
                    chart.titleField = "title";
                    chart.valueField = "amount";
                    chart.sequencedAnimation = true;
                    chart.startEffect = "elastic";
                    chart.innerRadius = "30%";
                    chart.startDuration = 2;
                    chart.labelRadius = 15;
                    chart.depth3D = 10;
                    chart.angle = 15;
                    chart.write("brokerage_all_chart");
                });
            </script>
            <div class="clear_fix"></div>
        </div>
    </div>
    {else /}
    <div class="box2">
        <h2>业绩分布统计</h2>
        <div class="item_chart">
            <div id="brokerage_all_chart_1" style="width:99%; height:400px;"></div>
            <script type="text/javascript">
                var chart;
                AmCharts.ready(function () {
                    chart = new AmCharts.AmPieChart();
                    chart.addTitle("我的业绩分布", 16);
                    chart.dataProvider = json['brokerage_all'];
                    chart.titleField = "title";
                    chart.valueField = "amount";
                    chart.sequencedAnimation = true;
                    chart.startEffect = "elastic";
                    chart.innerRadius = "30%";
                    chart.startDuration = 2;
                    chart.labelRadius = 15;
                    chart.depth3D = 10;
                    chart.angle = 15;
                    chart.write("brokerage_all_chart_1");
                });
            </script>
        </div>
    </div>
    {/if}

</div>
